package imagecutter;

/**
 *
 * @author faila
 */
public class ImageCutter {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Configuration readerProperties = new Configuration();
        ImageOperation imageObj = new ImageOperation();
        Cutter cut = new Cutter(args[0], args[1]);
        try {
            readerProperties.loadPropertiesFile(args[0]);
        } catch (Exception e) {
            System.out.println("Error while loading properties");
            System.exit(1);
        }
        
        try {
            imageObj.readImage(args[1]);
        } catch  (Exception e){
            System.out.println("Error while loading file image.");
            System.exit(1);
        }
        try {
            cut.cutImage();
            System.out.println("The image is cut.");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("Error while create image.");
        }
    }
}

